#include <stdio.h>
#include "process.h"
#include "String.h"
#include "tcp_server.h"
#include "tcp_server_select.h"
#include "tcp_client.h"
#include "tcp_client_poll.h"
#include <string.h>
#include "udp_echo_server.h"
#include "udp_echo_client.h"

extern int test_byte_order();

extern void test_transform_byte_order();

extern void test_manipulate_byte();

extern void test_transform_in_addr();


extern void test_String();

int main(int argc, char **argv) {

    // test_byte_order();

    // test_transform_byte_order();

    // test_manipulate_byte();

    // test_transform_in_addr();

    // sh();

    // test_String();

    char *arg1 = argv[1];
    printf("arg1 = %s\n", arg1);
    if (strcmp("server", arg1) == 0) {
        start_server();
    } else if (strcmp("server_select", arg1) == 0) {
        start_tcp_server_select();
    } else if (strcmp("client", arg1) == 0) {
        start_client();
    } else if (strcmp("client_poll", arg1) == 0) {
        start_client_poll();
    } else if (strcmp("udp_echo_server", arg1) == 0) {
        start_udp_echo_server();
    } else if (strcmp("udp_echo_client", arg1) == 0) {
        start_udp_echo_client();
    }

    printf("按任意键退出");
    getchar();
    return 0;
}